import { createRouter } from 'vue-router'
import { createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    redirect: '/dashboard'
  },
  {
    path: '/dashboard',
    name: 'Dashboard',
    component: () => import('../views/Dashboard.vue'),
    meta: { title: '仪表盘' }
  },
  {
    path: '/assets/add',
    name: 'AssetAdd',
    component: () => import('../views/AssetForm.vue'),
    meta: { title: '添加资产' }
  },
  {
    path: '/assets/edit/:id',
    name: 'AssetEdit',
    component: () => import('../views/AssetForm.vue'),
    meta: { title: '编辑资产' }
  },
  {
    path: '/assets/detail/:id',
    name: 'AssetDetail',
    component: () => import('../views/AssetDetail.vue'),
    meta: { title: '资产详情' }
  },
  {
    path: '/asset-categories',
    name: 'AssetCategories',
    component: () => import('../views/AssetCategories.vue'),
    meta: { title: '资产建档' }
  },
  {
    path: '/asset-categories/add',
    name: 'AssetCategoryAdd',
    component: () => import('../views/AssetCategoryForm.vue'),
    meta: { title: '新建资产档案' }
  },
  {
    path: '/asset-categories/edit/:id',
    name: 'AssetCategoryEdit',
    component: () => import('../views/AssetCategoryForm.vue'),
    meta: { title: '编辑资产档案' }
  },
  {
    path: '/asset-maintenance',
    name: 'AssetMaintenance',
    component: () => import('../views/AssetMaintenance.vue'),
    meta: { title: '资产维护' }
  },
  {
    path: '/asset-transfer',
    name: 'AssetTransfer',
    component: () => import('../views/AssetTransfer.vue'),
    meta: { title: '资产调拨' }
  },
  {
    path: '/asset-inventory',
    name: 'AssetInventory',
    component: () => import('../views/AssetInventory.vue'),
    meta: { title: '资产盘点' }
  },
  {
    path: '/asset-inventory/create',
    name: 'AssetInventoryCreate',
    component: () => import('../views/AssetInventoryCreate.vue'),
    meta: { title: '创建盘点任务' }
  },
  {
    path: '/asset-inventory/execute/:id',
    name: 'AssetInventoryExecute',
    component: () => import('../views/AssetInventoryExecute.vue'),
    meta: { title: '执行盘点任务' }
  },
  {
    path: '/asset-inventory/report/:id',
    name: 'AssetInventoryReport',
    component: () => import('../views/AssetInventoryReport.vue'),
    meta: { title: '盘点报表' }
  },
  {
    path: '/asset-disposal',
    name: 'AssetDisposal',
    component: () => import('../views/AssetDisposal.vue'),
    meta: { title: '资产减档' }
  },
  {
    path: '/asset-disposal/apply/:id',
    name: 'AssetDisposalApply',
    component: () => import('../views/AssetDisposalApply.vue'),
    meta: { title: '资产报废申请' }
  },
  {
    path: '/low-value-storage',
    name: 'LowValueStorage',
    component: () => import('../views/LowValueStorage.vue'),
    meta: { title: '低值易耗品出入库' }
  },
  {
    path: '/asset-query',
    name: 'AssetQuery',
    component: () => import('../views/AssetQuery.vue'),
    meta: { title: '资产信息查询' }
  },
  {
    path: '/settings',
    name: 'Settings',
    component: () => import('../views/Settings.vue'),
    meta: { title: '系统设置' }
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router